std: sys: fs: uefi: Implement File::flush#150862
std: sys: fs: uefi: Implement File::flush#150862rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use |
| pub fn flush(&self) -> io::Result<()> { | ||
| unsupported() | ||
| self.0.flush() | ||
| } |
There was a problem hiding this comment.
The Write::flush method should be a noop for Files. It's only meant to flush buffered writers to the OS, since files are unbuffered there's nothing to do.
There was a problem hiding this comment.
I have made it a noop and added a comment for the same. However, while it is a noop on unix and windows, other platforms like motor, solid, etc seem to call normal file flush on it.
There was a problem hiding this comment.
Thanks for the ping!
Re: flushing a file on Motor OS: the story is a bit complicated: while at the moment the call is a noop, it won't be in the future, as Motor OS is moving towards a fully asynchronous I/O (at the moment file I/O is synchronous) with in-process async runtime, so flushing a file will not stay a noop. The good news is that the call is already plumbed through to Motor OS runtime, so no changes to Rust std are expected.
- Make flush a noop since it is only for buffered writers. - Also forward fsync to datasync. UEFI does not have anything separate for metadata sync. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
b83eb4e to
f6f901f
Compare
|
@bors r+ |
std: sys: fs: uefi: Implement File::flush - Also forward fsync and datasync to flush. UEFI does not have anything separate for metadata sync. @rustbot label +O-UEFI
std: sys: fs: uefi: Implement File::flush - Also forward fsync and datasync to flush. UEFI does not have anything separate for metadata sync. @rustbot label +O-UEFI
std: sys: fs: uefi: Implement File::flush - Also forward fsync and datasync to flush. UEFI does not have anything separate for metadata sync. @rustbot label +O-UEFI
std: sys: fs: uefi: Implement File::flush - Also forward fsync and datasync to flush. UEFI does not have anything separate for metadata sync. @rustbot label +O-UEFI
Rollup of 14 pull requests Successful merges: - #148941 (stabilize `Peekable::next_if_map` (`#![feature(peekable_next_if_map)]`)) - #150368 (adding Ordering enum to minicore.rs, importing minicore in "tests/assembly-llvm/rust-abi-arg-attr.rs" test file) - #150668 (Unix implementation for stdio set/take/replace) - #150743 (Reword the collect() docs) - #150776 (Fix the connect_error test on FreeBSD 15+) - #150781 (Use `rand` crate more idiomatically) - #150786 (mGCA: Support array expression as direct const arguments) - #150812 (Bump `diesel` to the most recent commit in `cargotest`) - #150862 (std: sys: fs: uefi: Implement File::flush) - #150873 (Reenable GCC CI download) - #150908 (llvm: Update `reliable_f16` configuration for LLVM22) - #150918 (std: sys: fs: uefi: Implement File::seek) - #150922 (Subscribe myself to attr parsing) - #150930 (Remove special case for `AllowedTargets::CrateLevel`) r? @ghost
Rollup of 14 pull requests Successful merges: - #148941 (stabilize `Peekable::next_if_map` (`#![feature(peekable_next_if_map)]`)) - #150368 (adding Ordering enum to minicore.rs, importing minicore in "tests/assembly-llvm/rust-abi-arg-attr.rs" test file) - #150668 (Unix implementation for stdio set/take/replace) - #150743 (Reword the collect() docs) - #150776 (Fix the connect_error test on FreeBSD 15+) - #150781 (Use `rand` crate more idiomatically) - #150812 (Bump `diesel` to the most recent commit in `cargotest`) - #150862 (std: sys: fs: uefi: Implement File::flush) - #150873 (Reenable GCC CI download) - #150908 (llvm: Update `reliable_f16` configuration for LLVM22) - #150918 (std: sys: fs: uefi: Implement File::seek) - #150922 (Subscribe myself to attr parsing) - #150930 (Remove special case for `AllowedTargets::CrateLevel`) - #150942 (Port `#[rustc_has_incoherent_inherent_impls]` to attribute parser) Failed merges: - #150943 (Port `#[must_not_suspend]` to attribute parser) r? @ghost
Rollup of 14 pull requests Successful merges: - rust-lang/rust#148941 (stabilize `Peekable::next_if_map` (`#![feature(peekable_next_if_map)]`)) - rust-lang/rust#150368 (adding Ordering enum to minicore.rs, importing minicore in "tests/assembly-llvm/rust-abi-arg-attr.rs" test file) - rust-lang/rust#150668 (Unix implementation for stdio set/take/replace) - rust-lang/rust#150743 (Reword the collect() docs) - rust-lang/rust#150776 (Fix the connect_error test on FreeBSD 15+) - rust-lang/rust#150781 (Use `rand` crate more idiomatically) - rust-lang/rust#150812 (Bump `diesel` to the most recent commit in `cargotest`) - rust-lang/rust#150862 (std: sys: fs: uefi: Implement File::flush) - rust-lang/rust#150873 (Reenable GCC CI download) - rust-lang/rust#150908 (llvm: Update `reliable_f16` configuration for LLVM22) - rust-lang/rust#150918 (std: sys: fs: uefi: Implement File::seek) - rust-lang/rust#150922 (Subscribe myself to attr parsing) - rust-lang/rust#150930 (Remove special case for `AllowedTargets::CrateLevel`) - rust-lang/rust#150942 (Port `#[rustc_has_incoherent_inherent_impls]` to attribute parser) Failed merges: - rust-lang/rust#150943 (Port `#[must_not_suspend]` to attribute parser) r? @ghost
@rustbot label +O-UEFI